In [22]:
# Standard Python importations for scientific
from pylab import *
# to plot inside the notebook
%matplotlib inline
Here we define the curvature radius $r$ and the curve parameter $t$. The profiles $\left(x(t),y(t)\right)$ are parametrized such as $t\in[-1,1]$.
In [23]:
r = 35e-3
t = linspace(-1,1,101)
We define the $x(t)$ and various $y(t)$ functions for circular, parabolic and hyperbolic secant profiles respectively.
In [26]:
x = -r*sin(t*pi/4)
y_cir = +r*cos(t*pi/4)
y_par = -1/(sqrt(2)*r)*x**2 + r*3/(2*sqrt(2))
y_hyp = r*cosh(1/sqrt(2))**2 / sinh(1/sqrt(2)) / cosh(x/r) + r/sqrt(2) - r/tanh(1/sqrt(2))
In [27]:
# Plotting the results
plot(x, y_cir, x, y_par, x, y_hyp, lw=2)
axis('equal')
grid()
legend(('Circle', 'Parabolic', 'Hyperbolic Secant'))
Out[27]:
In [25]: